import { Component } from 'react';
import { Redirect, Route } from 'react-router-dom';

export default class Routers extends Component {
	render () {
		const { components } = this.props;
		if (window.sessionStorage.getItem('token') == null) {
			return (
				<Redirect to="/login"></Redirect>
			)
		} else {
			return (
				<Route component={components}></Route>
			)
		}
	}
}
